package cn.iocoder.yudao.module.system.enums.merchant;

import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum CertificationEnum implements IntArrayValuable {

    PENDING(0, "待审核"),
    SUCCESS(1, "已通过"),
    FAIL(2, "未通过");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CertificationEnum::getStatus).toArray();

    private final Integer status;

    private final String name;

    public static String getName(Integer type) {
        for(CertificationEnum item : CertificationEnum.values()){
            if(item.getStatus().equals(type)){
                return item.getName();
            }
        }
        return null;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}
